package com.maigao.api.controller;

import com.maigao.entity.ResultJson;
import com.maigao.entity.enums.ResultStatus;
import com.maigao.core.cache.JedisClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/")
public class IndexController {
    @Autowired
    private JedisClient jedisClient;

    @ResponseBody
    @RequestMapping("index")
    public ResultJson index() {
        String value = jedisClient.get("test");
        ResultJson resultJson = new ResultJson(ResultStatus.SUCCESS);
        resultJson.setMsg(value);
        return resultJson;
    }

}
